<template>
  <el-form ref="ruleForm" :model="form" label-width="100px" style="margin: 0 auto;width:100%;">
    <el-form-item label="审批意见">
      <el-input v-model="comments" type="textarea" :autosize="{ minRows: 2, maxRows: 2}" :disabled="true" />
    </el-form-item>
  </el-form>
</template>

<script>
import { getInfo } from '@/api/approvalComments'

export default {
  inject: ['getList'],
  props: { // 第二种方式
    xiangmu: {
      type: String,
      required: true
    },
    proid: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      comments: '',
      disabled: false
    }
  },
  mounted() {
    this.getDetailed()
  },
  methods: {
    getDetailed() {
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      getInfo({ code: this.proid }).then(response => {
        this.comments = response.data.approvalComments.comments

        loading.close()
      }).catch(function() {
        loading.close()
      })
    }
  }
}
</script>

<style scoped>

</style>
